home *** CD-ROM | disk | FTP | other *** search
- #define GAME_C
-
- #include <stdio.h>
- #include <stdlib.h>
- #include "game.h"
-
-
- void piece_move(PIECE piece)
- {
- switch (piece->piece_type){
- case PAWN:
- pawn_move(piece->moves->PawnM);
- break;
- case BISHOP:
- bishop_move(piece->moves->BishopM);
- break;
- case ROOK:
- rook_move(piece->moves->RookM);
- break;
- case KING:
- king_move(piece->moves->KingM);
- break;
- default:
- fprintf(stderr, "Unknown Playing piece.\n");
- exit (1);
- }
- }
-
- void calling_func()
- {
- PIECE tmp;
-
- /* set tmp equal to one of game pieces */
- /*...*/
- move_piece (tmp);
- }
-
-